<template>
	<x-widget :type="type" v-if="type"></x-widget>
</template>

<script>
	export default {
		data() {
			return {
				type: null
			}
		},
		mounted() {
			this.init()
		},
		methods: {
			async init() {
				if (this.$route.fullPath.toLowerCase().indexOf('/#/admin') > -1) {
					var path = this.$route.fullPath.replace('/#/', '/')
					this.$router.push(path)
				} else {
					if (this.$route.hash.indexOf('#/web/') > -1) {
						var path = this.$route.hash.replace('#/', '/')
						this.$router.push(path)
					} else {
						this.$router.push('/admin/index')
					}
				}
			}
		}
	}
</script>